All Questions
6 questions
4votes
7answers
279views
Breaking a string expression in operator and operands
Requesting for a code review for a scala implementation. Problem Given an expression string made of numbers and operators +,-,/,* , break it in a list of Integer or ...
2votes
3answers
124views
Is My Function to Find Triplets in Scala running in O(N^2)
Given the classical problem to find triplets that sum to zero in an array. Is my Scala implementation correct and executed in O(N^2)? If yes, why? Can someone make a running time analysis. What other ...
2votes
0answers
319views
KMP algorithm in scala
I implemented KMP pattern matching algorithm in Scala. My code works but it looks more imperative and a scala translation of C/C++ implementation. I am not able to figure out how to manage multiple ...
0votes
1answer
531views
Print words in decreasing order of frequency in Scala
Given a string print its words in decreasing order of frequency. Example: i/p - "aa bbb ccc aa ddd aa ccc" o/p - aa,ccc,ddd,bbb Scala: ...
1vote
1answer
497views
Check Is Anagram Scala HashMap based implementation
Here is the HashMap based implementation of the function checking whether two strings are anagrams: Example: ...
2votes
2answers
614views
A Scala Maze Generator in Functional Style
I'm wondering if there is more I can do to incorporate more idiomatic scala and functional programming principles. I know the maze itself is mutable but i didn't see an easy solution to making it ...